package org.jeecg.enums.charge;

/**
 * 生成方式  1:租户生成  2:业主生成
 */
public enum ChargeResidentTypeEnum {
    CHARGE_RESIDENT_TYPE_TENANT(1, "租户生成"),
    CHARGE_RESIDENT_TYPE_CUSTOMER(2, "业主生成");

    private Integer code;
    private String desc;

    ChargeResidentTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        ChargeResidentTypeEnum[] enums = values();
        for (ChargeResidentTypeEnum typeEnum : enums) {
            if (value.intValue() == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        ChargeResidentTypeEnum[] enums = values();
        for (ChargeResidentTypeEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }
}
